package com.lab303.powerproject.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class PageLoadConfig {

    @Bean
    public WebMvcConfigurer webMvcConfigurer(){
        return new WebMvcConfigurer() {
            @Override
            public void addViewControllers(ViewControllerRegistry registry) {
                registry.addViewController("/").setViewName("login");
                registry.addViewController("/new.html").setViewName("new");
                registry.addViewController("/air.html").setViewName("air");
                registry.addViewController("/solar_pv.html").setViewName("solar_pv");
                registry.addViewController("/geothermal_energy.html").setViewName("geothermal_energy");
                registry.addViewController("/electricity_storage.html").setViewName("electricity_storage");
                registry.addViewController("/solar_receiver.html").setViewName("solar_receiver");
                registry.addViewController("/water.html").setViewName("water");
                registry.addViewController("/strategy.html").setViewName("strategy");
                registry.addViewController("/strategyEdit.html").setViewName("strategyEdit");
                registry.addViewController("/device.html").setViewName("device");
                registry.addViewController("/moduleMgmt.html").setViewName("moduleMgmt");
                registry.addViewController("/strategyDemo.html").setViewName("strategyDemo");
                registry.addViewController("/index1").setViewName("strategyDemo1");
                registry.addViewController("/main").setViewName("strategyDemo2");
                registry.addViewController("/chart.html").setViewName("chart");
                registry.addViewController("/chart1.html").setViewName("chart1");
                registry.addViewController("/chart2.html").setViewName("chart2");
                registry.addViewController("/chart3.html").setViewName("chart3");
                registry.addViewController("/property.html").setViewName("property");
                registry.addViewController("/propertyEdit.html").setViewName("propertyEdit");
                registry.addViewController("/addProperty.html").setViewName("addProperty");
                registry.addViewController("/knowChart.html").setViewName("knowChart");
                registry.addViewController("/knowChartAdd.html").setViewName("knowChartAdd");
                registry.addViewController("/view.html").setViewName("view");
                registry.addViewController("/new.html").setViewName("new");
                registry.addViewController("/edge.html").setViewName("edge");
                registry.addViewController("/edgeAdd.html").setViewName("edgeAdd");
                registry.addViewController("/edgeEdit.html").setViewName("edgeEdit");
                registry.addViewController("/dragChart.html").setViewName("dragChart");
                registry.addViewController("/chart4.html").setViewName("chart4");
                registry.addViewController("/chartTest.html").setViewName("chartTest");
                registry.addViewController("/testLayUI.html").setViewName("testLayUI");
                registry.addViewController("/viewChart.html").setViewName("viewChart");
                registry.addViewController("/chartDraw.html").setViewName("chartDraw");
                registry.addViewController("/login.html").setViewName("login");












//                registry.addViewController("/elePrice.html").setViewName("elePrice");



            }
        };
    }
}
